Skip to content

fix(openai-agents): Stop destructively wrapping tools - #6961

Merged
alexander-alderman-webb merged 38 commits into
masterfrom
webb/openai-agents-tool-overwrite
Jul 31, 2026
Merged

fix(openai-agents): Stop destructively wrapping tools#6961
alexander-alderman-webb merged 38 commits into
masterfrom
webb/openai-agents-tool-overwrite

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Overwrite the on_invoke_tool property instead of wrapping the entire tool.

Otherwise, the follow-up PR has the test error

FAILED tests/integrations/openai_agents/test_openai_agents.py::test_tool_definitions[True-True] - agents.exceptions.UserError: ToolSearchTool() requires at least one searchable Responses surface: a tool_namespace(...) function tool, a deferred-loading function tool (`function_tool(..., defer_loading=True)`), or a deferred-loading hosted MCP server (`HostedMCPTool(tool_config={..., 'defer_loading': True})`).

as defer_loading is not forwarded in the wrapper.

Issues

Reminders

@alexander-alderman-webb
alexander-alderman-webb changed the base branch from webb/openai-agents-tool-definitions to webb/openai-agents-agent-tool-definitions July 30, 2026 14:26
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

99634 passed | ⏭️ 6757 skipped | Total: 106391 | Pass Rate: 93.65% | Execution Time: 354m 50s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2505 uncovered lines.
❌ Project coverage is 89.88%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    89.89%    89.88%    -0.01%
==========================================
  Files          193       193         —
  Lines        24750     24750         —
  Branches      8858      8858         —
==========================================
+ Hits         22247     22245        -2
- Misses        2503      2505        +2
- Partials      1414      1414         —

Generated by Codecov Action

Comment thread sentry_sdk/integrations/openai_agents/patches/tools.py
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review July 31, 2026 08:55
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner July 31, 2026 08:55
Comment thread sentry_sdk/integrations/openai_agents/patches/tools.py Outdated
Comment thread sentry_sdk/integrations/openai_agents/patches/tools.py

@sentrivana sentrivana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but check out the bot comments if you haven't yet in case there's something to them

Base automatically changed from webb/openai-agents-agent-tool-definitions to master July 31, 2026 12:32
@alexander-alderman-webb

Copy link
Copy Markdown
Contributor Author

I've just removed the idempotency guard since there's none currently in place with wrapping either.

Comment thread sentry_sdk/integrations/openai_agents/patches/tools.py

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7f5cc96. Configure here.

Comment thread sentry_sdk/integrations/openai_agents/patches/tools.py
@alexander-alderman-webb
alexander-alderman-webb merged commit 9d67eb2 into master Jul 31, 2026
140 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/openai-agents-tool-overwrite branch July 31, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants